﻿using System;
using System.IO;
using Character;
using UnityEngine;

/// <summary>个性</summary>
public class Personality
{
	// Token: 0x060008F4 RID: 2292 RVA: 0x00034098 File Offset: 0x00032298
	public void Init()
	{
		this.vaginaVirgin = true;//Y处
		this.analVirgin = true;//G处
		this.feelVagina = false;
		this.feelAnus = false;
		this.indecentLanguage = false;
		this.likeFeratio = false;
		this.likeSperm = false;
		this.expFeelVagina = 0;
		this.expFeelAnus = 0;
		this.expIndecentLanguage = 0;
		this.expLikeFeratio = 0;
		this.expLikeSperm = 0;
		this.addFeelVagina = 0;
		this.addFeelAnus = 0;
		this.addIndecentLanguage = 0;
		this.addLikeFeratio = 0;
		this.addLikeSperm = 0;
		this.state = Personality.STATE.FIRST;
		this.weakness = false;
		this.ahe = false;
		this.gagItem = GAG_ITEM.NONE;
		this.continuousInsVagina = 0;
		this.continuousInsAnal = 0;
		this.xtc_count_vagina = 0;
		this.xtc_count_anal = 0;
		this.eja_count_vagina = 0;
		this.eja_count_anal = 0;
		this.eja_count = 0;
		this.spermInCntV = 0;
		this.spermInCntA = 0;
		this.lostVaginaVirgin = false;
		this.lostAnalVirgin = false;
		this.insertVagina = false;
		this.insertAnal = false;
	}

	// Token: 0x060008F5 RID: 2293 RVA: 0x00034194 File Offset: 0x00032394
	public bool IsRequireAdjustment()
	{
		bool flag = false;
		flag |= (!this.feelVagina && (float)this.addFeelVagina > 0f);
		flag |= (!this.feelAnus && (float)this.addFeelAnus > 0f);
		flag |= (!this.indecentLanguage && (float)this.addIndecentLanguage > 0f);
		flag |= (!this.likeFeratio && (float)this.addLikeFeratio > 0f);
		flag |= (!this.likeSperm && (float)this.addLikeSperm > 0f);
		return flag | (this.lostVaginaVirgin | this.lostAnalVirgin);
	}

	// Token: 0x060008F6 RID: 2294 RVA: 0x00034250 File Offset: 0x00032450
	public void Save(BinaryWriter writer)
	{
		writer.Write(this.vaginaVirgin);
		writer.Write(this.analVirgin);
		writer.Write(this.feelVagina);
		writer.Write(this.feelAnus);
		writer.Write(this.indecentLanguage);
		writer.Write(this.likeFeratio);
		writer.Write(this.likeSperm);
		writer.Write(this.expFeelVagina);
		writer.Write(this.expFeelAnus);
		writer.Write(this.expIndecentLanguage);
		writer.Write(this.expLikeFeratio);
		writer.Write(this.expLikeSperm);
		writer.Write(this.addFeelVagina);
		writer.Write(this.addFeelAnus);
		writer.Write(this.addIndecentLanguage);
		writer.Write(this.addLikeFeratio);
		writer.Write(this.addLikeSperm);
		writer.Write((int)this.state);
		writer.Write((int)this.gagItem);
		writer.Write(this.continuousInsVagina);
		writer.Write(this.continuousInsAnal);
	}

	// Token: 0x060008F7 RID: 2295 RVA: 0x0003435C File Offset: 0x0003255C
	public void Load(BinaryReader reader, int version)
	{
		this.vaginaVirgin = reader.ReadBoolean();
		this.analVirgin = reader.ReadBoolean();
		this.feelVagina = reader.ReadBoolean();
		this.feelAnus = reader.ReadBoolean();
		this.indecentLanguage = reader.ReadBoolean();
		this.likeFeratio = reader.ReadBoolean();
		this.likeSperm = reader.ReadBoolean();
		this.expFeelVagina = reader.ReadInt32();
		this.expFeelAnus = reader.ReadInt32();
		this.expIndecentLanguage = reader.ReadInt32();
		this.expLikeFeratio = reader.ReadInt32();
		this.expLikeSperm = reader.ReadInt32();
		this.addFeelVagina = reader.ReadInt32();
		this.addFeelAnus = reader.ReadInt32();
		this.addIndecentLanguage = reader.ReadInt32();
		this.addLikeFeratio = reader.ReadInt32();
		this.addLikeSperm = reader.ReadInt32();
		this.state = (Personality.STATE)reader.ReadInt32();
		if (version >= 1)
		{
			this.gagItem = (GAG_ITEM)reader.ReadInt32();
		}
		if (version >= 3)
		{
			this.continuousInsVagina = reader.ReadInt32();
			this.continuousInsAnal = reader.ReadInt32();
		}
	}

	// Token: 0x17000121 RID: 289
	// (get) Token: 0x060008F8 RID: 2296 RVA: 0x00034474 File Offset: 0x00032674
	public float ExpFeelVaginaRate
	{
		get
		{
			return (!this.feelVagina) ? Personality.Rate(this.expFeelVagina, 15) : 1f;
		}
	}

	// Token: 0x17000122 RID: 290
	// (get) Token: 0x060008F9 RID: 2297 RVA: 0x00034498 File Offset: 0x00032698
	public float ExpFeelAnusRate
	{
		get
		{
			return (!this.feelAnus) ? Personality.Rate(this.expFeelAnus, 15) : 1f;
		}
	}

	// Token: 0x17000123 RID: 291
	// (get) Token: 0x060008FA RID: 2298 RVA: 0x000344BC File Offset: 0x000326BC
	public float ExpIndecentLanguageRate
	{
		get
		{
			return (!this.indecentLanguage) ? Personality.Rate(this.expIndecentLanguage, 21) : 1f;
		}
	}

	// Token: 0x17000124 RID: 292
	// (get) Token: 0x060008FB RID: 2299 RVA: 0x000344E0 File Offset: 0x000326E0
	public float ExpLikeFeratioRate
	{
		get
		{
			return (!this.likeFeratio) ? Personality.Rate(this.expLikeFeratio, 15) : 1f;
		}
	}

	// Token: 0x17000125 RID: 293
	// (get) Token: 0x060008FC RID: 2300 RVA: 0x00034504 File Offset: 0x00032704
	public float ExpLikeSpermRate
	{
		get
		{
			return (!this.likeSperm) ? Personality.Rate(this.expLikeSperm, 15) : 1f;
		}
	}

	// Token: 0x060008FD RID: 2301 RVA: 0x00034528 File Offset: 0x00032728
	private static float Rate(int now, int max)
	{
		if (max == 0)
		{
			return 1f;
		}
		return Mathf.Clamp01((float)now / (float)max);
	}

	// Token: 0x060008FE RID: 2302 RVA: 0x00034540 File Offset: 0x00032740
	public void AdjustmentExp()
	{
		this.expFeelVagina = Mathf.Min(this.expFeelVagina + this.addFeelVagina, 15);
		this.expFeelAnus = Mathf.Min(this.expFeelAnus + this.addFeelAnus, 15);
		this.expIndecentLanguage = Mathf.Min(this.expIndecentLanguage + this.addIndecentLanguage, 21);
		this.expLikeFeratio = Mathf.Min(this.expLikeFeratio + this.addLikeFeratio, 15);
		this.expLikeSperm = Mathf.Min(this.expLikeSperm + this.addLikeSperm, 15);
		this.addFeelVagina = 0;
		this.addFeelAnus = 0;
		this.addIndecentLanguage = 0;
		this.addLikeFeratio = 0;
		this.addLikeSperm = 0;
		if (this.lostVaginaVirgin)
		{
			this.vaginaVirgin = false;
			this.lostVaginaVirgin = false;
		}
		if (this.lostAnalVirgin)
		{
			this.analVirgin = false;
			this.lostAnalVirgin = false;
		}
	}

	// Token: 0x060008FF RID: 2303 RVA: 0x00034624 File Offset: 0x00032824
	public void AdjustmentExp_Free()
	{
		this.addFeelVagina = 0;
		this.addFeelAnus = 0;
		this.addIndecentLanguage = 0;
		this.addLikeFeratio = 0;
		this.addLikeSperm = 0;
		this.lostVaginaVirgin = false;
		this.lostAnalVirgin = false;
	}

	// Token: 0x06000900 RID: 2304 RVA: 0x00034658 File Offset: 0x00032858
	public void H_In()
	{
		this.weakness = false;
		this.ahe = false;
		this.xtc_count_vagina = 0;
		this.xtc_count_anal = 0;
		this.eja_count_vagina = 0;
		this.eja_count_anal = 0;
		this.eja_count = 0;
		this.spermInCntV = 0;
		this.spermInCntA = 0;
	}

	// Token: 0x06000901 RID: 2305 RVA: 0x000346A4 File Offset: 0x000328A4
	public void AddFeelVagina()
	{
		if (!this.feelVagina)
		{
			this.addFeelVagina = Mathf.Min(this.addFeelVagina + 1, 3);
		}
	}

	// Token: 0x06000902 RID: 2306 RVA: 0x000346C8 File Offset: 0x000328C8
	public void AddFeelAnus()
	{
		if (!this.feelAnus)
		{
			this.addFeelAnus = Mathf.Min(this.addFeelAnus + 1, 3);
		}
	}

	// Token: 0x06000903 RID: 2307 RVA: 0x000346EC File Offset: 0x000328EC
	public void AddIndecentLanguage()
	{
		if (!this.indecentLanguage)
		{
			this.addIndecentLanguage = Mathf.Min(this.addIndecentLanguage + 1, 3);
		}
	}

	// Token: 0x06000904 RID: 2308 RVA: 0x00034710 File Offset: 0x00032910
	public void AddLikeFeratio()
	{
		if (!this.likeFeratio)
		{
			this.addLikeFeratio = Mathf.Min(this.addLikeFeratio + 1, 3);
		}
	}

	// Token: 0x06000905 RID: 2309 RVA: 0x00034734 File Offset: 0x00032934
	public void AddLikeSperm()
	{
		if (!this.likeSperm)
		{
			this.addLikeSperm = Mathf.Min(this.addLikeSperm + 1, 3);
		}
	}

	// Token: 0x06000906 RID: 2310 RVA: 0x00034758 File Offset: 0x00032958
	public void LostVaginaVirgin()
	{
		this.lostVaginaVirgin = true;
	}

	// Token: 0x06000907 RID: 2311 RVA: 0x00034764 File Offset: 0x00032964
	public void LostAnalVirgin()
	{
		this.lostAnalVirgin = true;
	}

	// Token: 0x06000908 RID: 2312 RVA: 0x00034770 File Offset: 0x00032970
	public bool IsLostVaginaVirgin()
	{
		return this.lostVaginaVirgin;
	}

	// Token: 0x06000909 RID: 2313 RVA: 0x00034778 File Offset: 0x00032978
	public bool IsLostAnalVirgin()
	{
		return this.lostAnalVirgin;
	}

	// Token: 0x0600090A RID: 2314 RVA: 0x00034780 File Offset: 0x00032980
	public bool IsFloped(HEROINE heroine)
	{
		return Personality.IsFloped(this.state, heroine);
	}

	// Token: 0x0600090B RID: 2315 RVA: 0x00034790 File Offset: 0x00032990
	public static bool IsFloped(Personality.STATE checkState, HEROINE heroine)
	{
		if (checkState == Personality.STATE.FLIP_FLOP)
		{
			return heroine != HEROINE.AKIKO;
		}
		return checkState > Personality.STATE.RESIST;
	}

	// Token: 0x04000881 RID: 2177
	public const int ExpMax_FeelVagina = 15;

	// Token: 0x04000882 RID: 2178
	public const int ExpMax_FeelAnus = 15;

	// Token: 0x04000883 RID: 2179
	public const int ExpMax_IndecentLanguage = 21;

	// Token: 0x04000884 RID: 2180
	public const int ExpMax_LikeFeratio = 15;

	// Token: 0x04000885 RID: 2181
	public const int ExpMax_LikeSperm = 15;

	// Token: 0x04000886 RID: 2182
	public const int ExpMax_Add = 3;

	// Token: 0x04000887 RID: 2183
	public bool vaginaVirgin = true;

	// Token: 0x04000888 RID: 2184
	public bool analVirgin = true;

	// Token: 0x04000889 RID: 2185
	public bool feelVagina;

	// Token: 0x0400088A RID: 2186
	public bool feelAnus;

	// Token: 0x0400088B RID: 2187
	public bool indecentLanguage;

	// Token: 0x0400088C RID: 2188
	public bool likeFeratio;

	// Token: 0x0400088D RID: 2189
	public bool likeSperm;

	// Token: 0x0400088E RID: 2190
	public int expFeelVagina;

	// Token: 0x0400088F RID: 2191
	public int expFeelAnus;

	// Token: 0x04000890 RID: 2192
	public int expIndecentLanguage;

	// Token: 0x04000891 RID: 2193
	public int expLikeFeratio;

	// Token: 0x04000892 RID: 2194
	public int expLikeSperm;

	// Token: 0x04000893 RID: 2195
	private int addFeelVagina;

	// Token: 0x04000894 RID: 2196
	private int addFeelAnus;

	// Token: 0x04000895 RID: 2197
	private int addIndecentLanguage;

	// Token: 0x04000896 RID: 2198
	private int addLikeFeratio;

	// Token: 0x04000897 RID: 2199
	private int addLikeSperm;

	// Token: 0x04000898 RID: 2200
	public Personality.STATE state;

	// Token: 0x04000899 RID: 2201
	public GAG_ITEM gagItem;

	// Token: 0x0400089A RID: 2202
	public int continuousInsVagina;

	// Token: 0x0400089B RID: 2203
	public int continuousInsAnal;

	// Token: 0x0400089C RID: 2204
	public bool weakness;

	// Token: 0x0400089D RID: 2205
	public bool ahe;

	// Token: 0x0400089E RID: 2206
	public int xtc_count_vagina;

	// Token: 0x0400089F RID: 2207
	public int xtc_count_anal;

	// Token: 0x040008A0 RID: 2208
	public int eja_count_vagina;

	// Token: 0x040008A1 RID: 2209
	public int eja_count_anal;

	// Token: 0x040008A2 RID: 2210
	public int eja_count;

	// Token: 0x040008A3 RID: 2211
	public int spermInCntV;

	// Token: 0x040008A4 RID: 2212
	public int spermInCntA;

	// Token: 0x040008A5 RID: 2213
	private bool lostVaginaVirgin;

	// Token: 0x040008A6 RID: 2214
	private bool lostAnalVirgin;

	// Token: 0x040008A7 RID: 2215
	public bool insertVagina;

	// Token: 0x040008A8 RID: 2216
	public bool insertAnal;

	// Token: 0x0200015A RID: 346
	public enum STATE
	{
		// Token: 0x040008AA RID: 2218
		FIRST,
		// Token: 0x040008AB RID: 2219
		RESIST,
		// Token: 0x040008AC RID: 2220
		FLOP,
		// Token: 0x040008AD RID: 2221
		FLIP_FLOP,
		// Token: 0x040008AE RID: 2222
		LAST_EVENT_SISTERS,
		// Token: 0x040008AF RID: 2223
		LAST_EVENT_YUKIKO_1,
		// Token: 0x040008B0 RID: 2224
		LAST_EVENT_YUKIKO_2,
		// Token: 0x040008B1 RID: 2225
		LAST_EVENT_MARIKO,
		// Token: 0x040008B2 RID: 2226
		NUM
	}
}
